capture	log close
log using MAR06-PanelModels-UNODC,  replace text

//  program:    Stata 
//  task:       Panel Models 
//  project:    Markets  

version
clear all
macro drop _all
set linesize 80
set more off
local tag " 06-25-24| Cleaned 06-25-24"
local file "MAR06-PanelModels-UNODC"
local note "|`tag' | `file'"
local opt "noparen sideway excel noaster  bdec(2)  sdec(2)  pdec(3)   adec(2) e(r2) stats(coef se pval)"
local dv "lrhom_un"
local iv "fraser"
local iv2 "infantmort" 
local cont "edu unemp  popdense perurban  sexratio"

//	#0
//	Loading data 
use MAR05-QuantModels-UNODC.dta

//	#1
//	Panel models 
xtreg `dv' fraser `iv2' `cont', fe vce(cluster CID) 
	outreg2 using `file'.dta, replace `opt' 

foreach var in   heritage rol {
	xtreg `dv' `var' `iv2' `cont', fe vce(cluster CID) 
	outreg2 using `file'.dta, append `opt' 
	}

//	#2
//	Panel models without 
foreach var in fraser heritage rol {
	xtreg `dv' `var' `iv2' `cont', fe 
	outreg2 using `file'.dta, append `opt' 
	}

//	#3
//	save and close 
save `file'.dta, replace 
log close 
//